package net.mihome.app.utils;

import com.loopj.android.http.RequestParams;

import net.mihome.app.AppContext;
import net.mihome.app.bean.User;

/**
 * Created by zhao on 2015/1/30.
 */
public class RequestParamsFactory extends RequestParams {
    public static RequestParams newInstance(AppContext context){
        User user=context.getLoginInfo();
        if(user!=null&&user.getToken()!=null&&!"".equals(user.getToken())){
            RequestParams requestParams= new RequestParams("token",user.getToken());
            requestParams.add("community_id",user.getCommunityId()+"");
            requestParams.add("uid",user.getUid()+"");
            return requestParams;
        }else{
            return new RequestParams();
        }
    }
}
